package com.future.mayi.response;

import android.text.TextUtils;

import com.future.baselib.entity.BaseResponse;
import com.future.mayi.model.OrderNumModel;
import com.future.mayi.model.UserInfoModel;
import com.google.gson.reflect.TypeToken;
import com.future.mayi.app.App;
import com.future.mayi.model.AddressModel;

import org.json.JSONException;
import org.json.JSONObject;

import java.util.List;

public class AddressResponse extends BaseResponse {

    private List<AddressModel> list;

    @Override
    public void parseInfo(String content) throws JSONException {

        if (!TextUtils.isEmpty(content)) {
            JSONObject object = new JSONObject(content);
            String text = object.optString("list");
            list = App.getGson().fromJson(text, new TypeToken<List<AddressModel>>() {
            }.getType());
        }
    }

    public List<AddressModel> getList() {
        return list;
    }
}
